
from .meta import TempFile,IndexMeta,MoveIndex
from .handle import TopicHandle,IndexHandle
from .store import TopicIndexStore
# 初始化官方指定的TIS存储目录
MAIN_TIS = TopicIndexStore("./tistore_main")

if __name__ == "__main__":
    tis = TopicIndexStore("/Users/bytedance/works/auto_index/tistore_main")
    tis.AddTopic("local_files.list")
    topic_handle = tis.GetTopicHandle("local_files.list")
    index_handle = topic_handle.NewTempIndex("pick.ppk")
    # index_handle = topic_handle.GetIndexHandle("pick.ppk")
    print(index_handle)
    path = index_handle.GetIndexPath()
    with open(path,"w",encoding="utf-8") as fp:
        fp.write("asdlfkjasldfkjasdlkfaslkjf")
        fp.write("asdlfkjasldfkjasdlkfaslkjf")
        fp.write("asdlfkjasldfkjasdlkfaslkjf")
        fp.write("asdlfkjasldfkjasdlkfaslkjf")
        fp.close()
    index_handle.TurnOn()

